﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace zlsoft.BHExtend.Interface
{
   
    public class FileDispose
    {
        /// <summary>
        /// 通过本地文件路径，返回二进制
        /// </summary>
        /// <param name="LocalPath">文件本地路径</param>
        /// <returns> byte[]</returns>
        public static byte[] RaadLocalFileToByte(string LocalPath)
        {
            FileInfo fi = new FileInfo(LocalPath);
            byte[] buff = new byte[fi.Length];
            FileStream fs = fi.OpenRead();
            fs.Read(buff, 0, Convert.ToInt32(fs.Length));
            fs.Close();           
            return buff;
        }
    }
}
